import request from '@/utils/request'

// 活动位管理列表
export function queryActivilyList(params) {
  return request({
    url: '/admin/activeManage/list',
    method: 'post',
    data: {
      ...params
    }
  })
}

//保存活动位
export function saveActivily(params) {
  return request({
    url: '/admin/activeManage/add',
    method: 'post',
    data: {
      ...params
    }
  })
}

// 查询可用券任务

export function queryCouponList(params) {
  return request({
    url: '/admin/coupon/task/activityTaskList',
    method: 'get',
    params
  })
}


// 查询区域数据

export function queryAreaData(params) {
  return request({
    url: '/admin/baseProvince/list',
    method: 'post',
    data: {
      pid: 0,
      ...params
    }
  })
}

// 获取子级区域
export function queryAreaChildrenData(params) {
  return request({
    url: '/admin/baseProvince/listByPid',
    method: 'get',
    params
  })
}


// 启用/禁用活动位
export function openingActivity(params) {
  return request({
    url: '/admin/activeManage/updateManageStatus',
    method: 'post',
    data: params
  })
}

// 活动位详情
export function queryActivityDetail(params) {
  return request({
    url: '/admin/activeManage/getById',
    method: 'get',
    params
  })
}

// 编辑活动位
export function updateActivity(params) {
  return request({
    url: '/admin/activeManage/updateManage',
    method: 'post',
    data: {
      ...params
    }
  })
}

// 获取充值活动列表
export function queryRechargeList(params) {
  return request({
    url: '/admin/activity/list',
    method: 'post',
    data: {
      ...params
    }
  })
}
// 获取充值活动详情
export function queryRechargeDetail(params) {
  return request({
    url: '/admin/activity/getInfo',
    method: 'get',
    params
  })
}
// 新增充值活动
export function saveRecharge(params) {
  return request({
    url: '/admin/activity/add',
    method: 'post',
    data: {
      ...params
    }
  })
}
// 修改充值活动
export function updateRecharge(params) {
  return request({
    url: '/admin/activity/edit',
    method: 'post',
    data: {
      ...params
    }
  })
}
// 禁用充值活动
export function disableRecharge(params) {
  return request({
    url: '/admin/activity/disable',
    method: 'post',
    data: {
      ...params
    }
  })
}

// 启用充值活动
export function enableRecharge(params) {
  return request({
    url: '/admin/activity/enable',
    method: 'post',
    data: {
      ...params
    }
  })
}
